import React from 'react'
import { connect } from 'umi'

type Props = {
    dispatch: any
}
let dis: any = null

function Dis({ dispatch }: Props) {
    dis = dispatch
    return (
        <div>dis</div>
    )
}

function useDispatch() {
    return {
        dis
    }
}

export {
    useDispatch
}


const mapStateToProps = (state: any) => {
    const { hero } = state
    return {
        hero
    }
}

export default connect(mapStateToProps)(Dis)